package com.fishleap.boot;

import com.fishleap.client.RPCConsumer;
import com.fishleap.dto.RpcResponse;
import com.fishleap.service.IUserService;

/**
 * @author zlg
 */
public class ConsumerBoot {

    // 参数定义
//    private static final String PROVIDER_NAME = "UserService#sayHello#";

    public static void main(String[] args) throws InterruptedException {

        // 1.创建代理对象
        IUserService service = (IUserService) RPCConsumer.createProxy(IUserService.class);

        // 2.循环给服务器写数据
        while (true) {
            RpcResponse result = service.sayHello("Hello welcome !");
            System.out.println(result);
            Thread.sleep(2000);
        }
    }

}
